/* 通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.header p {
    font-size: 16px;
    opacity: 0.9;
}

/* 主要内容区域 */
.main-content {
    padding: 30px;
}

/* 数据区域样式 */
.data-section {
    margin-bottom: 25px;
}

.section-header {
    background: #f8f9fa;
    padding: 12px 20px;
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
}

.char-count {
    font-size: 14px;
    color: #6c757d;
    background: #e9ecef;
    padding: 4px 12px;
    border-radius: 15px;
}

.textarea-wrapper {
    border: 1px solid #e9ecef;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.data-textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: none;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    resize: vertical;
    outline: none;
    transition: background-color 0.3s;
}

.data-textarea:focus {
    background-color: #f8f9fa;
}

/* 操作按钮区域 */
.operations-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.operations-title {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 15px;
}

.operation-groups {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.operation-group {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.group-title {
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.operation-button {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.operation-button:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.operation-button:active {
    transform: translateY(0);
}

/* 特殊操作按钮 */
.operation-button.primary {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.operation-button.primary:hover {
    background: #5a67d8;
}

.operation-button.success {
    background: #48bb78;
    color: white;
    border-color: #48bb78;
}

.operation-button.success:hover {
    background: #38a169;
}

.operation-button.warning {
    background: #ed8936;
    color: white;
    border-color: #ed8936;
}

.operation-button.warning:hover {
    background: #dd6b20;
}

/* 参数输入模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-width: 400px;
}

.modal-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #495057;
}

.modal-body {
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #6c757d;
}

.input-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.input-group input:focus {
    border-color: #667eea;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.toolbar-button {
    padding: 10px 20px;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.toolbar-button:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

.toolbar-button i {
    font-size: 16px;
}

/* 提示信息 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: #48bb78;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 2000;
}

.toast.error {
    background: #e53e3e;
}

.toast.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
    }
    
    .button-grid {
        grid-template-columns: 1fr;
    }
    
    .operation-groups {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        min-width: 90%;
        margin: 20px;
    }
}
